﻿// Decompiled with JetBrains decompiler
// Type: XamlEditor.CloneUIElement
// Assembly: XamlEditor, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
// MVID: 2AF0471B-7BFE-4738-893B-A4F91E243353
// Assembly location: C:\Users\KasimGulcan\Desktop\Kosgeb\DynaCAD\Project\lib\XamlEditor.dll

using System.IO;
using System.Windows;
using System.Windows.Markup;
using System.Xml;

namespace XamlEditor
{
  public static class CloneUIElement
  {
    public static UIElement cloneElement(UIElement orig)
    {
      if (orig == null)
        return (UIElement) null;
      return (UIElement) XamlReader.Load(XmlReader.Create((TextReader) new StringReader(XamlWriter.Save((object) orig)), new XmlReaderSettings()));
    }
  }
}
